package com.example.calculation.controller;

import com.example.calculation.entity.Calculation;
import com.example.calculation.service.DroolsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: whb
 * @Date: 2021/10/11 16:41
 * @Description
 */
@RestController
@RequestMapping("/drools")
public class DroolsController {

    @Autowired
    private DroolsService droolsService;

    @GetMapping("/calculate")
    public String calculate(@RequestParam("wage") double wage) {
        Calculation calculate = droolsService.calculate(wage);
        return calculate.toString();
    }
}
